<!-- 导航栏 -->
<nav class="navbar navbar-default hidden-xs hidden-sm">
  <div class="container-fluid">
    <!-- 导航栏首部 -->
    <div class="navbar-header">
      <!-- Logo -->
      <%= link_to image_tag("logo.png", alt:"Milog", class: "logo"), main_app.root_path, class: "navbar-brand" %>
      <!-- 切换语系 -->
      <%= link_to_locale request.path, mclass: "navbar-text switch-lang" %>

      <%= content_tag(:span, "#{capitalize_name(@user)}'s Blog", class: "navbar-text ") if current_user != @user && yield(:hidden_nav_center_items).blank? %>
      <!-- 屏幕<=420px时显示 -->
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#collapse-nav">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
    </div>
    <!-- 操作菜单 -->
    <%= render 'shared/header_opt_menu' %>
    
    <!-- 主菜单项 -->
    <% if yield(:hidden_nav_center_items).blank? %>
    <div class="collapse navbar-collapse" id="collapse-nav">
      <ul class="nav navbar-nav navbar-center main-nav">
        <%= content_tag :li, link_to(t("blog"), main_app.blog_user_path(@user.username)) %>
        <%= content_tag :li, link_to(t("category"), main_app.categories_user_path(@user.username)) %>
        <%= content_tag :li, link_to(t("archive"), main_app.archive_user_path(@user.username)) %>
        <%= content_tag :li, link_to(t("aboutme"), main_app.aboutme_user_path(@user.username)) %>
        <%= content_tag :li, link_to(t("search"), "#", id: 'search') %>
      </ul>
    </div>
    <% end %>
  </div>
</nav>